package net.xdclass.order.feign;

import net.xdclass.common.JsonData;
import net.xdclass.order.model.request.LockCouponRecordRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "xdclass-coupon-service")
public interface CouponFeignClient {

    /**
     * 查询优惠券详情
     * @param recordId
     * @return
     */
    @GetMapping("/api/coupon_record/v1/detail/{id}")
    JsonData recordDetail(@PathVariable(value = "id") Long recordId);

    /**
     * 锁定优惠券库存
     * @param request
     * @return
     */
    @PostMapping("/api/coupon/v1/record/lock")
    JsonData lockCouponRecord(@RequestBody LockCouponRecordRequest request);
}
